#ifndef DRAWABLE_H_
#define DRAWABLE_H_

#include <SDL/SDL.h>
#include <map>

namespace JDL
{
  class Effect;
  class Drawable
  {
  public:
    Drawable();
    virtual ~Drawable();
    virtual void		Render(SDL_Surface *screen) = 0;
    SDL_Rect		GetPosition() const;
    void		SetPosition(int x, int y);
    void		SetSubRect(int x, int y, int w, int h);
    SDL_Rect		GetSubRect() const;
    SDL_Rect		GetSizeSurface();
    Uint8	        GetTransparency() const;
    void		AddEffect(std::string name, Effect *effect);
    void		DelEffect(std::string name);
    inline void		SetAlpha(int alpha)
    {
      SDL_SetAlpha(_surface, SDL_SRCALPHA, alpha);
    }

  protected:
    SDL_Rect	_clipper;
    SDL_Rect	_pos;
    SDL_Rect	_pos_c;
    SDL_Rect	_old_pos;
    SDL_Surface	*_surface;
    SDL_Rect	_zone;
    Uint8	_transparency;
    std::map<std::string, Effect*>	_effect;
    void	InitRect(SDL_Rect *rect);
  };
}

#endif
